﻿// Decompiled by AS3 Sorcerer 6.12
// www.as3sorcerer.com

//Fence

package 
{
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.display.Graphics;

    public class Fence extends Sprite 
    {

        private const _SafeStr_126:int = 5;

        private var _SafeStr_122:Number = 0;
        private var _SafeStr_124:Number = 0;
        private var _SafeStr_125:Number = 0;
        private var _SafeStr_123:Number = 0;
        private var _SafeStr_121:Sync = null;

        public function Fence(x1:Number, y1:Number, x2:Number, y2:Number)
        {
            this._SafeStr_125 = x1;
            this._SafeStr_124 = y1;
            this._SafeStr_123 = x2;
            this._SafeStr_122 = y2;
            this._SafeStr_121 = new Sync(0.2);
            this._SafeStr_93();
            addEventListener(Event.ENTER_FRAME, this.onEnterFrame);
        }

        public function get y2():Number
        {
            return (this._SafeStr_122);
        }

        public function get x2():Number
        {
            return (this._SafeStr_123);
        }

        public function destruct():void
        {
            graphics.clear();
        }

        public function set x1(x:Number):void
        {
            this._SafeStr_125 = x;
            this._SafeStr_93();
        }

        private function onEnterFrame(event:Event):void
        {
            this._SafeStr_121.tick();
            this._SafeStr_93();
        }

        private function _SafeStr_93():void
        {
            var g:Graphics = graphics;
            var dx:Number = (this._SafeStr_123 - this._SafeStr_125);
            var dy:Number = (this._SafeStr_122 - this._SafeStr_124);
            var a:Number = Math.atan2(dy, dx);
            var r:Number = this._SafeStr_126;
            var a90:Number = (Math.PI / 2);
            var a180:Number = Math.PI;
            var delta:Number = ((Math.sin(this._SafeStr_121.phase) * 5) + 2);
            var delta2:Number = (Math.sin((this._SafeStr_121.phase + a180)) + 2);
            g.clear();
            g.lineStyle(2, GUI.OUTLINE_COLOR);
            g.beginFill(5592371, 1);
            g.moveTo(((Math.cos((a + a90)) * r) + this._SafeStr_125), ((Math.sin((a + a90)) * r) + this._SafeStr_124));
            g.curveTo((((Math.cos((a + a180)) * r) * delta2) + this._SafeStr_125), (((Math.sin((a + a180)) * r) * delta2) + this._SafeStr_124), ((Math.cos((a - a90)) * r) + this._SafeStr_125), ((Math.sin((a - a90)) * r) + this._SafeStr_124));
            g.curveTo((((Math.cos((a - a90)) * delta) + (dx / 2)) + this._SafeStr_125), (((Math.sin((a - a90)) * delta) + (dy / 2)) + this._SafeStr_124), ((Math.cos((a - a90)) * r) + this._SafeStr_123), ((Math.sin((a - a90)) * r) + this._SafeStr_122));
            g.curveTo((((Math.cos(a) * r) * delta2) + this._SafeStr_123), (((Math.sin(a) * r) * delta2) + this._SafeStr_122), ((Math.cos((a + a90)) * r) + this._SafeStr_123), ((Math.sin((a + a90)) * r) + this._SafeStr_122));
            g.curveTo((((Math.cos((a + a90)) * delta) + (dx / 2)) + this._SafeStr_125), (((Math.sin((a + a90)) * delta) + (dy / 2)) + this._SafeStr_124), ((Math.cos((a + a90)) * r) + this._SafeStr_125), ((Math.sin((a + a90)) * r) + this._SafeStr_124));
            g.endFill();
        }

        public function set y1(y:Number):void
        {
            this._SafeStr_124 = y;
            this._SafeStr_93();
        }

        public function set y2(y:Number):void
        {
            this._SafeStr_122 = y;
            this._SafeStr_93();
        }

        public function get x1():Number
        {
            return (this._SafeStr_125);
        }

        public function set x2(x:Number):void
        {
            this._SafeStr_123 = x;
            this._SafeStr_93();
        }

        public function get y1():Number
        {
            return (this._SafeStr_124);
        }


    }
}//package 

// _SafeStr_121 = "_-Ao" (String#5173, DoABC#2)
// _SafeStr_122 = "_-W" (String#5281, DoABC#2)
// _SafeStr_123 = "_-Cg" (String#5258, DoABC#2)
// _SafeStr_124 = "_-4b" (String#4867, DoABC#2)
// _SafeStr_125 = "_-9a" (String#5106, DoABC#2)
// _SafeStr_126 = "_-i" (String#5290, DoABC#2)
// _SafeStr_93 = "_-1j" (String#4736, DoABC#2)


